/*
 * $Header: /opt/javacvs/util/src/main/java/com/uusee/util/ArrayUtil.java,v 1.1 2008/04/03 04:53:23 duy Exp $
 * $Revision: 1.1 $
 * $Date: 2008/04/03 04:53:23 $
 * ============================================================================
 *
 * Copyright (c) 2008 Beijing uusee Tech CO.,  All rights reserved.
 *
 * ============================================================================
 */
package com.uusee.util;

import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;

/**
 * 
 * 
 * @author <a href="mailto:du_yi@bbn.cn">duyi</a>
 * 
 * Create Time: 2008-4-3 下午01:41:33
 */
public class ArrayUtil {
	private static Log log = LogFactory.getLog(ArrayUtil.class);

	/**
	 * 判断数组是否非空
	 * 
	 * @param array
	 * @return
	 */
	public static boolean isNotEmpty(Object[] array) {
		if (array == null) {
			if (log.isDebugEnabled()) {
				log.debug("数组为空");
			}
			return false;
		}
		if (array.length == 0) {
			if (log.isDebugEnabled()) {
				log.debug("数组长度为零");
			}
			return false;
		}
		if (log.isDebugEnabled()) {
			log.debug("数组长度: " + array.length);
		}
		return true;
	}

	/**
	 * 判断数组是否为空
	 * 
	 * @param array
	 * @return
	 */
	public static boolean isEmpty(Object[] array) {
		return !isNotEmpty(array);
	}
}
